package com.stylefeng.guns.modular.system.warpper;

import java.text.DecimalFormat;
import java.util.List;
import java.util.Map;

import com.stylefeng.guns.core.base.warpper.BaseControllerWarpper;

public class BrankWarpper extends BaseControllerWarpper{

	public BrankWarpper(List<Map<String, Object>> list) {
        super(list);
    }

    @Override
    public void warpTheMap(Map<String, Object> map) {
    	DecimalFormat df = new DecimalFormat("0.00");
    	double gAvgRate1dc = ((Double)map.get("gAvgRate1dc"));
		map.put("gAvgRate1dc", (gAvgRate1dc >0 ? "<font color='red'><b>"+df.format(gAvgRate1dc)+"</b></font>" : "<font color='green'><b>"+df.format(gAvgRate1dc)+"</b></font>"));
		double gAvgRate2dc = ((Double)map.get("gAvgRate2dc"));
		map.put("gAvgRate2dc", (gAvgRate2dc >0 ? "<font color='red'><b>"+df.format(gAvgRate2dc)+"</b></font>" : "<font color='green'><b>"+df.format(gAvgRate2dc)+"</b></font>"));
		double gAvgRate3dc = ((Double)map.get("gAvgRate3dc"));
		map.put("gAvgRate3dc", (gAvgRate3dc >0 ? "<font color='red'><b>"+df.format(gAvgRate3dc)+"</b></font>" : "<font color='green'><b>"+df.format(gAvgRate3dc)+"</b></font>"));
		
    }
}
